public class copy {
    public static void main(String[] args) {
        //把数组的元素复制到一个新数组去
        int arr[] = {1, 2, 3, 3, 5, 6, 7};
        int[] copy = newarr(arr);
        for (int i = 0; i < copy.length; i++) {
            System.out.println(copy[i]);
        }

    }

    public static int[] newarr(int arr[]) {
        int[] newArr = new int[7];
        for (int i = 0; i < arr.length; i++) {
            newArr[i] = arr[i];
        }
        return newArr;
    }
}
